<?
echo '<div class="graph_ping_status"><h3>Device Status / Response Times <span>(Last 6hrs)</span></h3>';
echo '<img class="graph" width="820" height="100" src="/graph.php?device='.$device->id.'&type=pingTimes&width=820&height=100&start=-6h&legend=0" title="Device Status / Response Times" graph="device='.$device->id.'&type=pingTimes&start=-6h" />';
echo '</div>';

if ($device->useSNMP) {
	echo '<div class="columns">';
		echo '<div class="column" style="width:500px;">';
			echo '<div class="graph_processor_utilization">';
				echo '<h3>Processor Utilization <span>(Last 6 hours)</span></h3>';
				echo '<img class="graph"width="500" height="100" src="/graph.php?device='.$device->id.'&type=windowsDeviceProcessorUsage&width=500&height=100&legend=0&start=-6h" title="Click to View Larger Version" graph="device='.$device->id.'&type=windowsDeviceProcessorUsage&start=-6h"/>';	
			echo '</div>';
			echo '<div class="network_traffic">';
				echo '<h3>Network Traffic <span>(Last 6hrs)</span></h3>';
				echo '<img class="graph" width="500" height="100" src="/graph.php?device='.$device->id.'&type=deviceTraffic&width=500&height=100&legend=0" graph="device='.$device->id.'&type=deviceTraffic&start=-6h"/>';
			echo '</div>';

			echo '<h3 class="iconFlag">Recent Events <span>(Last 20)</span></h3>';
			echo 'asdas';
		echo '</div>';
		echo '<div class="column system_resources">';
			echo '<h3>System Resources</h3>';
			echo '<div class="group">Processors</div>';	
			foreach ($device->cpus AS $cpu) {
				echo '<div class="param iconProcessors" graph="device='.$device->id.'&index='.$cpu->index.'&type=processorUsage&start=-1h&title=CPU '.$i.' - Usage over the last hour">';
				echo '<a href="/device/'.$device->id.'/processor/'.$cpu->index.'/">'.$cpu->getDescription().'</a>';
				echo '<span class="barGauge '.($cpu->getPercentageLoad()>60?($cpu->getPercentageLoad()>80?'alert':'caution'):'').'"><span class="bar"style="width:'.$cpu->getPercentageLoad().'%;"></span><span class="text">'.$cpu->getPercentageLoad().'%</span></span>';
				echo '</div>';
			}
			echo '<div class="group">Memory</div>';	
			foreach ($device->memory AS $ram) {
				echo '<div class="param iconMemory" graph="device='.$device->id.'&index='.$ram->index.'&type=storageUsage&start=-1h&title='.$ram->getDescription().' - Usage over the last hour">';
				echo '<a href="/device/'.$device->id.'/memory/'.$ram->index.'/">'.$ram->getDescription().'</a>';
				echo '<span class="barGauge '.($ram->getPercentageLoad()>60?($ram->getPercentageLoad()>80?'alert':'caution'):'').'"><span class="bar"style="width:'.$ram->getPercentageLoad().'%;"></span><span class="text">'.$ram->getPercentageLoad().'%</span></span>';
				echo '</div>';		
			}
			echo '<div class="group">Storage</div>';	
			foreach ($device->storage AS $storage) {
				echo '<div class="param iconStorage" graph="device='.$device->id.'&index='.$storage->index.'&type=storageUsage&start=-1h&title='.$storage->getDescription().' - Usage over the last hour">';
				echo $storage->getDescription();
				echo '<span class="barGauge '.($storage->getPercentageLoad()>60?($storage->getPercentageLoad()>80?'alert':'caution'):'').'"><span class="bar"style="width:'.$storage->getPercentageLoad().'%;"></span><span class="text">'.$storage->getPercentageLoad().'%</span></span>';
				echo '</div>';		
			}
			echo '<div class="group ">Network Interfaces</div>';
			foreach ($device->interfaces AS $interface) {
				
				if (!$interface->ignore) {
					echo '<div class="param iconInterfaces '.($interface->isDown()?'down':'').'" graph="device='.$device->id.'&index='.$interface->ifIndex.'&type=interfaceTraffic&start=-1h">';
					echo '<span class="out">'.$interface->getCurrentThroughput('out').'/s</span>';
					echo '<span class="in">'.$interface->getCurrentThroughput('in').'/s</span>';
					echo '<a href="/device/'.$device->id.'/interface/'.$interface->id.'/">'.$interface->getDescription(22).'</a>';
					echo '</div>';
				}
			}	
			echo '<div class="group">Services</div>';
		echo '</div>';
	echo '</div>';
			
	
}
?>